package com.fenghongzhang.day008view;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ViewGroup;

public class MyGroup extends ViewGroup {

    private static final String TAG = "MyGroup";

    public MyGroup(Context context) {
        super(context);
    }

    public MyGroup(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.i(TAG, "dispatchTouchEvent: ");
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        Log.i(TAG, "onInterceptTouchEvent: ");
        return true;

    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.i(TAG, "onTouchEvent: ");
        switch (event.getAction()){
            case MotionEvent.ACTION_DOWN:
                Log.i(TAG, "onTouchEvent: 按下");

                break;
                case MotionEvent.ACTION_UP:
                    Log.i(TAG, "onTouchEvent:抬起 ");

                    break;
            case MotionEvent.ACTION_MOVE:
                Log.i(TAG, "onTouchEvent:移动 ");
                break;
        }
        return true;

    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {

    }
}
